<template>

    <div class="app-container" v-if="canList">
        <div class="filter-container">
            <!--            <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item input"-->
            <!--                      placeholder="上传者的ID"-->
            <!--                      v-model="listQuery.userId">-->
            <!--            </el-input>-->
            <el-input @keyup.enter.native="handleFilter" style="width: 200px;" class="filter-item input"
                      placeholder="产品名字"
                      v-model="listQuery.name">
            </el-input>
            <el-input v-if=" !isWg && roleId.indexOf(18) == -1" @keyup.enter.native="handleFilter" style="width: 200px;"
                      class="filter-item input"
                      placeholder="店铺名"
                      v-model="listQuery.shopName">
            </el-input>
            <!--            <el-select @change='handleFilter' clearable class="filter-item input" style="width: 130px"-->
            <!--                       v-model="listQuery.openSku"-->
            <!--                       placeholder="开启规格">-->
            <!--                <el-option v-for="(item,index) in  openSkuOptions" :key="item" :label="item" :value="index">-->
            <!--                </el-option>-->
            <!--            </el-select>-->
            <el-select v-if="!isWg " @change='handleFilter' clearable class="filter-item input" style="width: 130px"
                       v-model="listQuery.shelf"
                       placeholder="是否上架">
                <el-option v-for="(item,index) in  adminShelfOptions" :key="item" :label="item" :value="oldIndex">
                </el-option>
            </el-select>
            <el-cascader
                    placeholder="分类"
                    :options="mallTypes"
                    @change="handleFilter"
                    :props="queryProp"
                    v-model="types"
                    clearable
                    filterable>
            </el-cascader>
            <el-select v-if="userId == null" @change='handleFilter' clearable class="filter-item input"
                       style="width: 130px;margin-left: 10px"
                       v-model="listQuery.saleType"
                       placeholder="售卖类型">
                <el-option v-if="item != ''" v-for="(item,index) in  adminSaleTypeOptions" :key="item" :label="item"
                           :value="oldIndex">
                </el-option>
            </el-select>

            <el-button style="margin-left: 10px;" class="filter-item input" type="primary" v-waves icon="el-icon-search"
                       @click="handleFilter">查找
            </el-button>
            <el-button class="filter-item input" style="margin-left: 10px;" @click="handleCreate" type="primary"
                       v-if="canSave" icon="el-icon-edit">添加
            </el-button>
            <!--            <el-button class="filter-item input" type="primary" :loading="downloadLoading" v-waves icon="el-icon-download"-->
            <!--                       @click="handleDownload">导出-->
            <!--            </el-button>-->
        </div>

        <el-table :key='tableKey' :data="list" v-loading="listLoading" border fit highlight-current-row
                  style="width: 100%;min-height:1000px;">
            <el-table-column align="center" label="序号">
                <template slot-scope="scope">
                    <span>{{scope.row.id}}</span>
                </template>
            </el-table-column>
            <!--            <el-table-column align="center" label="上传者的ID">-->
            <!--                <template slot-scope="scope">-->
            <!--                    <span>{{scope.row.userId}}</span>-->
            <!--                </template>-->
            <!--            </el-table-column>-->
            <el-table-column align="center" label="店铺" width="150">
                <template slot-scope="scope">
                    <span>{{scope.row.shopEntity?scope.row.shopEntity.name:getShopName}}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="产品名字" width="150">
                <template slot-scope="scope">
                    <span>{{scope.row.name}}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="单位">
                <template slot-scope="scope">
                    <span>{{scope.row.unit}}</span>
                </template>
            </el-table-column>
            <el-table-column v-if="userId == null" align="center" label="虚拟销量">
                <template slot-scope="scope">
                    <span>{{scope.row.sales}}</span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="重量kg">
                <template slot-scope="scope">
                    <span>{{scope.row.weight}}</span>
                </template>
            </el-table-column>
            <!--            <el-table-column align="center" label="描述">-->
            <!--                <template slot-scope="scope">-->
            <!--                    <span>{{scope.row.info}}</span>-->
            <!--                </template>-->
            <!--            </el-table-column>-->
            <!--            <el-table-column align="center" label="分享标题">-->
            <!--                <template slot-scope="scope">-->
            <!--                    <span>{{scope.row.title}}</span>-->
            <!--                </template>-->
            <!--            </el-table-column>-->
            <!--            <el-table-column align="center" label="原价">-->
            <!--                <template slot-scope="scope">-->
            <!--                    <span>{{scope.row.oldPrice}}</span>-->
            <!--                </template>-->
            <!--            </el-table-column>-->
            <!--   <el-table-column align="center" label="现价">
                   <template slot-scope="scope">
                       <span>{{scope.row.nowPrice}}</span>
                   </template>
               </el-table-column>-->
            <!--            <el-table-column align="center" label="成本价">-->
            <!--                <template slot-scope="scope">-->
            <!--                    <span>{{scope.row.primePrice}}</span>-->
            <!--                </template>-->
            <!--            </el-table-column>-->

            <el-table-column align="center" label="库存">
                <template slot-scope="scope">
                    <span>{{scope.row.stock}}</span>
                </template>
            </el-table-column>
            <!--            <el-table-column align="center" label="开启规格">-->
            <!--                <template slot-scope="scope">-->
            <!--                                                <span>-->

            <!--                         <el-tag :type="tagTypes[scope.row.openSku]">     {{openSkuOptions[scope.row.openSku]} }</el-tag>-->

            <!--                        </span>-->
            <!--                </template>-->
            <!--            </el-table-column>-->
            <el-table-column align="center" label="是否上架">
                <template slot-scope="scope">
                                                <span>

                         <el-tag :type="tagTypes[scope.row.shelf]">     {{adminShelfOptions[scope.row.shelf]}}</el-tag>

                        </span>
                </template>
            </el-table-column>
            <el-table-column align="center" label="售卖类型">
                <template slot-scope="scope">
                                                            <span>

                                     <el-tag :type="tagTypes[scope.row.saleType]">     {{adminSaleTypeOptions[scope.row.saleType]}}</el-tag>

                                    </span>
                </template>
            </el-table-column>

            <el-table-column align="center" label="排序">
                <template slot-scope="scope">
                    <span>{{scope.row.sort}}</span>
                </template>
            </el-table-column>

            <el-table-column align="center" label="操作" width="230" class-name="small-padding fixed-width">
                <template slot-scope="scope">
                    <el-button type="warning" v-if="canUpdate" size="mini" @click="handleStock(scope)">入库
                    </el-button>
                    <el-button type="primary" v-if="canUpdate" size="mini" @click="handleUpdate(scope.row)">编辑
                    </el-button>
                    <el-button v-if="canSave" size="mini" type="danger"
                               @click="handleDelete(scope.row)">删除
                    </el-button>
                    <el-button style="margin-top: 5px" size="mini" type="info"
                               @click="handleAdjust(scope.row)">调整
                    </el-button>
                </template>
            </el-table-column>

        </el-table>

        <div class="pagination-container">
            <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
                           :current-page="listQuery.page" :page-sizes="[10,20,30, 50]" :page-size="listQuery.limit"
                           layout="total, sizes, prev, pager, next, jumper" :total="total">
            </el-pagination>
        </div>

        <el-dialog title="入库" :visible.sync="dialogStockVisible">
            <el-form ref="dataForm" label-position="left"
                     style='width: 50%; margin-left:20%;' label-width="80px">
                <el-form-item label="产品名字" prop="name">
                    <el-input  v-model="stock.goodsName"></el-input>
                </el-form-item>
                <el-form-item label="产品SKU" prop="name" v-if="temp.mallSkus&&temp.mallSkus.length>0">
                    <el-select @change="changeStockSku" v-model="stock.skuName" placeholder="请选择">
                        <el-option
                                v-for="item in temp.mallSkus"
                                :key="item.name"
                                :label="item.name"
                                :value="item.name">
                        </el-option>
                    </el-select>
                </el-form-item>

                <el-form-item label="库存" prop="unit">
                    <el-input type="number" disabled v-model="stock.oldQuantity"></el-input>
                </el-form-item>
                <el-form-item label="增量" prop="unit">
                    <el-input type="number" v-model="stock.quantity"></el-input>
                </el-form-item>
                <el-form-item label="备注" prop="unit">
                    <el-input type="textarea" v-model="stock.remark"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogStockVisible=false">取消</el-button>
                <el-button @click="updateStock" type="primary">确认</el-button>
            </div>
        </el-dialog>

        <el-dialog :before-close="closeDialogForm"  :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="65%">
            <el-form :rules="rules" ref="dataForm" :model="temp" label-position="left" label-width="120px"
                     style='width: 70%; margin-left:50px;'>
                <!--                <el-form-item label="上传者的ID" prop="userId">-->
                <!--                    <el-input v-model="temp.userId"></el-input>-->
                <!--                </el-form-item>-->
                <el-form-item label="产品名字" prop="name">
                    <el-input :disabled="adjustFlag" v-model="temp.name"></el-input>
                </el-form-item>
                <el-form-item label="分类" prop="types" :show-all-levels="false">
                    <el-cascader
                            :disabled="adjustFlag"
                            collapse-tags
                            v-model="fenLeiTypes"
                            :options="mallTypes"
                            :props="props"
                            @change="handleChange"
                            clearable></el-cascader>
                    <!--  <el-select v-model="flTypes" multiple placeholder="产品分类" >
                          <el-option
                                  v-for="item in  mallTypes"
                                  :key="item.id"
                                  :label="item.name"
                                  :value="item.id">
                          </el-option>
                      </el-select>-->
                </el-form-item>
                <el-form-item label="售卖类型" prop="saleType">
                    <el-select :disabled="saleTypeFlag" @change="selectPrice" v-if="userId != null" class="filter-item" v-model="temp.saleType" placeholder="售卖类型">
                        <el-option  v-if="item != ''" v-for="(item,index) in saleTypeOptions" :key="item" :label="item"
                                   :value="oldIndex">
                        </el-option>
                    </el-select>
                    <el-select :disabled="saleTypeFlag" @change="selectPrice" v-else class="filter-item" v-model="temp.saleType" placeholder="售卖类型">
                        <el-option  v-if="item != ''" v-for="(item,index) in adminSaleTypeOptions" :key="item"
                                   :label="item"
                                   :value="oldIndex">
                        </el-option>
                    </el-select>
                </el-form-item>
                <div class="levels" style="width: 130%;margin-bottom: 20px"
                     v-if="temp.saleType===0 || temp.saleType === 3 || temp.saleType === 5 || temp.saleType === 18 || temp.saleType === 17 ||temp.saleType === 2">
                    <!-- <el-form-item label="必需积分" prop="nowPrice">
                         <el-input placeholder="必需积分" v-model="saleTypeInfoEntity.point"></el-input>
                     </el-form-item>-->

                    <el-form-item v-if="temp.saleType != 5 && temp.saleType != 17" label="可抵扣优惠券">
                        <el-input :disabled="adjustFlag" placeholder="最高可抵扣优惠券" v-model="maxCoupon"></el-input>
                    </el-form-item>
                    <!--<el-form-item label="可抵扣换购券" prop="nowPrice">
                        <el-input placeholder="最高可抵扣换购券" v-model="saleTypeInfoEntity.maxVoucher"></el-input>
                    </el-form-item>-->
                    <div v-if="temp.saleType == 5">
                        <el-form-item  label="采购价" prop="shopPrice">
                            <el-input :disabled="adjustFlag" v-model="shopPrice" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"></el-input>
                        </el-form-item>
                        <el-form-item  :label="shopPrice?'分享奖励换购劵(最低:'+shopPrice*100/1000+')':'分享奖励换购劵(最低:'+0+')'" prop="nowPrice">
                            <el-input :disabled="adjustFlag"  placeholder="分享奖励换购劵" v-model="voucherReward"></el-input>
                        </el-form-item>
                        <el-form-item :label="shopPrice?'分享奖励代金劵(最低:'+shopPrice*100/1000+')':'分享奖励代金劵(最低:'+0+')'" prop="nowPrice">
                            <el-input :disabled="adjustFlag" placeholder="分享奖励代金劵"  v-model="cashReward"></el-input>
                        </el-form-item>
                    </div>
                    <div v-if="temp.saleType != 5 && temp.saleType != 18 && temp.saleType != 17">
                        <el-form-item  label="分享奖励换购劵" prop="nowPrice">
                            <el-input :disabled="adjustFlag"  placeholder="分享奖励换购劵" v-model="voucherReward"></el-input>
                        </el-form-item>
                        <el-form-item label="分享奖励代金劵" prop="nowPrice">
                            <el-input :disabled="adjustFlag" placeholder="分享奖励代金劵"  v-model="cashReward"></el-input>
                        </el-form-item>
                        <el-form-item v-if="userId == null"  label="分享奖励优惠券" prop="nowPrice">
                            <el-input :disabled="adjustFlag" placeholder="分享奖励优惠券" v-model="couponReward"></el-input>
                        </el-form-item>
                    </div>
                    <div v-if="temp.saleType === 17">
                        <el-form-item  label="可抵扣清货券">
                            <el-input :disabled="adjustFlag" placeholder="可抵扣清货券" v-model="maxClear"></el-input>
                        </el-form-item>
                    </div>
                    <el-form-item v-if="temp.saleType ==2" label="限购数量">
                        <el-input :disabled="adjustFlag" placeholder="限购数量" v-model="act.number"></el-input>
                    </el-form-item>
                </div>
                <el-form-item v-if="userId == null" label="赠送清货券" prop="nowPrice">
                    <el-input :disabled="adjustFlag" placeholder="赠送清货券"  v-model="clearReward"></el-input>
                </el-form-item>
                <div  disabled="true" class="levels" style="width: 130%;margin-bottom: 20px" v-if="temp.saleType==1 ">


                    <el-table

                            :data="[1]"
                            border
                            style="width: 100%">
                        <el-table-column
                                align="center"
                                label="级别"
                        >
                            <template slot-scope="scope">
                                <span>价格</span>
                            </template>
                        </el-table-column>
                        <el-table-column v-for="(price,index) in temp.prices" :key="oldIndex"
                                         align="center"
                                         :label="price.levelName"
                        >

                            <template slot-scope="scope">
                                <el-input :disabled=priceFlag v-model="price.price"></el-input>
                            </template>
                        </el-table-column>

                    </el-table>
                </div>
                <el-form-item label="原价" prop="oldPrice">
                    <el-input :disabled="adjustFlag" v-model="temp.oldPrice" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"></el-input>
                </el-form-item>
                <el-form-item label="现价" prop="nowPrice">
                    <el-input :disabled="adjustFlag" v-model="temp.nowPrice"></el-input>
                </el-form-item>
                <el-form-item v-if="temp.saleType == 1" label="供货价" prop="nowPrice">
                    <el-input :disabled="adjustFlag" v-model="supplyPrice"></el-input>
                </el-form-item>
                <div v-if="temp.saleType != 17">
                    <el-form-item v-if="userId != null" label="区域服务津贴" prop="managerReward">
                        省
                        <el-input disabled style="width: 80px;white-space:nowrap" placeholder="省"
                                  v-model="province"></el-input>
                        市
                        <el-input disabled style="width: 80px;margin-left: 5px" placeholder="市" v-model="city"></el-input>
                        区
                        <el-input disabled style="width: 80px;margin-left: 5px" placeholder="区" v-model="area"></el-input>
                        ‰
                    </el-form-item>
                    <el-form-item v-else label="区域服务津贴" prop="managerReward">
                        省
                        <el-input style="width: 80px;white-space:nowrap" placeholder="省" v-model="province"></el-input>
                        市
                        <el-input style="width: 80px;margin-left: 5px" placeholder="市" v-model="city"></el-input>
                        区
                        <el-input style="width: 80px;margin-left: 5px" placeholder="区" v-model="area"></el-input>
                        ‰
                    </el-form-item>
                    <el-form-item v-if="userId != null" label="店铺服务津贴" prop="nowPrice">
                        <el-input disabled style="width: 80px" v-model.number="shopReward"></el-input>
                        <span>%</span>
                    </el-form-item>
                    <el-form-item v-else label="店铺服务津贴" prop="nowPrice">
                        <el-input  style="width: 80px" v-model.number="shopReward"></el-input>
                        <span>%</span>
                    </el-form-item>
                </div>
                <el-form-item label="分享标题" prop="title">
                    <el-input :disabled="adjustFlag" v-model="temp.title"></el-input>
                </el-form-item>
                <el-form-item label="描述" prop="info">
                    <el-input :disabled="adjustFlag"  type="textarea" maxlength="200" @input="this.descInput" v-model="temp.info" ></el-input>
                    <span style="float:right;color:#999;">最多输入字数:{{this.remnant}}/{{this.maxRemnant}}</span>
                </el-form-item>
                <div style="display: flex">
                    <div>
                        <el-form-item v-if="!isWg" label="产品分享信息" prop="info">
                            <el-select :disabled="adjustFlag" @change="handleact" class="filter-item input"  v-model="goodsShare" placeholder="分享信息">
                                <el-option  v-for="(item,index) in  goodsShareOptions" :key="item" :label="item"
                                            :value="oldIndex">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item  v-if="goodsShare == 0" label="优惠描述" prop="info">
                            <el-input :disabled="adjustFlag" style="width: 190px" v-model="temp.discountInfo" placeholder="优惠描述四个字内"></el-input>
                        </el-form-item>
                        <el-form-item  v-if="goodsShare == 0" label="优惠价格" prop="info">
                            <el-input :disabled="adjustFlag" style="width: 190px"  v-model="temp.discountPrice"  onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" placeholder="优惠价格三位数内"></el-input>
                        </el-form-item>
                        <el-form-item  v-if="goodsShare == 0" label="活动信息" prop="info">
                            <el-input :disabled="adjustFlag" style="width: 190px" v-model="temp.actInfo" placeholder="活动信息八个字内"></el-input>
                        </el-form-item>
                        <el-form-item  v-if="goodsShare == 1" label="卖点主题" prop="info">
                            <el-input :disabled="adjustFlag" style="width: 190px" v-model="temp.buyTheme" placeholder="卖点主题四个字内"></el-input>
                        </el-form-item>
                        <el-form-item  v-if="goodsShare == 1" label="卖点信息" prop="info">
                            <el-input :disabled="adjustFlag" style="width: 190px" v-model="temp.buyInfo" placeholder="卖点信息八个字内"></el-input>
                        </el-form-item>
                    </div>
                    <div v-if="goodsShare == 0">
                        <img style="width: 200px;height: 300px" src="../../../assets/huodongxinxi.png"/>
                        <div style="margin-left: 20px;color: red">示例图片</div>
                    </div>
                    <div v-if="goodsShare == 1">
                        <img style="width: 200px;height: 300px" src="../../../assets/maidian.png"/>
                        <div style="margin-left: 20px;color: red">示例图片</div>
                    </div>
                </div>
                <!--<el-form-item label="产品分享海报" prop="postImg">
                    <el-upload
                            ref="postImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlepostImgUploadSuccess"
                            :data="qData"
                            :file-list="postImgList"
                            :on-remove="handlepostImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->
                <el-form-item label="开启规格" prop="status" v-if="temp.saleType!=1">
                    <el-select :disabled="adjustFlag" class="filter-item input" v-model="temp.openSku" placeholder="开启规格">
                        <el-option v-for="(item,index) in  openSkuOptions" :key="item" :label="item"
                                   :value="oldIndex">
                        </el-option>
                    </el-select>
                </el-form-item>
                <Sku :qData="qData" :disableFlag="adjustFlag" v-if="dialogFormVisible&&temp.openSku&&!adjustFlag" :skuThemes="temp.skuThemes"
                     :mallSkus="temp.mallSkus" :showFlag="temp.saleType" @updateSku="updateSku">
                </Sku>
                <el-form-item v-if="!userId" label="开启每日优选" prop="status" >
                    <el-select class="filter-item input" v-model="temp.dailySel" placeholder="开启每日优选">
                        <el-option v-for="(item,index) in  dailySelOptions" :key="item" :label="item"
                                   :value="oldIndex">
                        </el-option>
                    </el-select>
                </el-form-item>
                <div v-if="userId != null">
                    <el-form-item  label="生产日期" prop="createTime">
                        <el-date-picker :disabled="adjustFlag" v-model="temp.createTime" type="datetime"
                                        value-format="yyyy-MM-dd HH:mm:ss" placeholder="生产日期">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="保质期" prop="guaranty">
                        <el-input :disabled="adjustFlag" v-model="temp.guaranty"></el-input>
                    </el-form-item>
                </div>
                <div v-else>
                    <el-form-item  label="生产日期" prop="">
                        <el-date-picker :disabled="adjustFlag" v-model="temp.createTime" type="datetime"
                                        value-format="yyyy-MM-dd HH:mm:ss" placeholder="生产日期">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="保质期" prop="">
                        <el-input :disabled="adjustFlag" v-model="temp.guaranty"></el-input>
                    </el-form-item>
                </div>
                <el-form-item label="单位/规格(如：1盒/5条)" prop="unit">
                    <el-input :disabled="adjustFlag" v-model="temp.unit"></el-input>
                </el-form-item>

                <el-form-item v-if="userId == null" label="虚拟销量" prop="sales">
                    <el-input :disabled="adjustFlag" v-model="temp.sales"></el-input>
                </el-form-item>
                <!--                <el-form-item label="过期时间" prop="expDate">-->
                <!--                    <el-input v-model="temp.expDate"></el-input>-->
                <!--                </el-form-item>-->

                <el-form-item label="物流规则" prop="logType">
                    <el-select :disabled="adjustFlag" class="filter-item" v-model="temp.logType" placeholder="物流规则">
                        <el-option v-for="(item,index) in  logTypeOptions" :key="item" :label="item"
                                   :value="oldIndex">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item v-if="temp.logType==1" label="满免数量" prop="fullNumber">
                    <el-input :disabled="adjustFlag" v-model="temp.fullNumber"></el-input>
                </el-form-item>

                <el-form-item v-if="temp.logType==1" label="未满邮费" prop="logFee">
                    <el-input :disabled="adjustFlag" v-model="temp.logFee"></el-input>
                </el-form-item>

                <el-form-item v-if="temp.logType==2" label="产品重量kg" prop="weight">
                    <el-input :disabled="adjustFlag" v-model="temp.weight"></el-input>
                </el-form-item>
                <el-form-item v-if="userId == null && temp.logType==2" label="每箱数量" prop="perBox">
                    <el-input :disabled="adjustFlag" v-model="temp.perBox"></el-input>
                </el-form-item>
                <el-form-item v-if="userId != null && temp.logType == 2" label="物流模板" prop="">
                    <el-select :disabled="adjustFlag" v-if="shopLogTemList.length > 0" class="filter-item" v-model="temp.logTemId" placeholder="物流模板">
                        <el-option v-for="(item) in  shopLogTemList" :key="item.id" :label="item.name"
                                   :value="item.id">
                        </el-option>
                    </el-select>
                    <el-select :disabled="adjustFlag" v-else @change="selectChange" class="filter-item" v-model="temp.logTemId" placeholder="物流模板">
                        <el-option v-for="(item,index) in  shopLogTems" :key="oldIndex" :label="item"
                                   :value="oldIndex">
                        </el-option>
                    </el-select>
                </el-form-item>

                <!--   <el-form-item label="是否转货" prop="status">
                       <el-select class="filter-item" v-model="saleTypeInfoEntity.transfer"   placeholder="是否转货">
                           <el-option v-for="(item,index) in  options" :key="item" :label="item"
                                      :value="index">
                           </el-option>
                       </el-select>
                   </el-form-item>
                   <el-form-item label="是否发货">
                       <el-select class="filter-item" v-model="saleTypeInfoEntity.delivery"   placeholder="是否发货">
                           <el-option v-for="(item,index) in  options" :key="item" :label="item"
                                      :value="index">
                           </el-option>
                       </el-select>
                   </el-form-item>
                   <el-form-item label="利润" prop="primePrice">
                       <el-input v-model="temp.profit"></el-input>
                   </el-form-item>
                   -->
                <el-form-item v-if="userId == null" label="排序" prop="sort">
                    <el-input :disabled="adjustFlag" v-model="temp.sort"></el-input>
                </el-form-item>
                <el-form-item label="库存" prop="stock">
                    <el-input v-model="temp.stock" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"></el-input>
                </el-form-item>
                <el-form-item v-if="userId != null" label="是否上架" prop="status">
                    <el-select :disabled="adjustFlag" class="filter-item input"  v-model="temp.shelf" placeholder="是否上架">
                        <el-option v-if="item != ''" v-for="(item,index) in  userShelfOptions"
                                   :key="item"
                                   :label="item"
                                   :value="oldIndex"
                        >
                        </el-option>
                    </el-select>
                </el-form-item>
                    <el-form-item v-else label="是否上架" prop="status">
                        <el-select :disabled="adjustFlag" class="filter-item input"  v-model="temp.shelf" placeholder="是否上架">
                            <el-option v-for="(item,index) in  adminShelfOptions"
                                       :key="item"
                                       :label="item"
                                       :value="oldIndex"
                            >
                            </el-option>
                        </el-select>
                    </el-form-item>
                <el-form-item label="品牌名称" prop="brandName">
                    <el-input :disabled="adjustFlag" v-model="goodsTemp.brandName" placeholder="请填写品牌名称"></el-input>
                </el-form-item>
                <el-form-item label="品牌简介" prop="brandInfo">
                    <el-input :disabled="adjustFlag" v-model="goodsTemp.brandInfo" placeholder="请填写品牌简介"></el-input>
                </el-form-item>
                <div :class="imgDiv"  v-if="!isWg">
                    <el-form-item
                             v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1|| this.bigTypes.indexOf(48) > -1|| this.bigTypes.indexOf(415) > -1"
                            label="生产企业卫生许可证" prop="companyhealthLicense">

                        <UnloadImg
                                :list="companyHealthLicenseList"
                                :onSuccess="handlecompanyhealthLicenseUploadSuccess"
                                @update="companyHealthLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1 || this.bigTypes.indexOf(61) > -1|| this.bigTypes.indexOf(46) > -1|| this.bigTypes.indexOf(55) > -1|| this.bigTypes.indexOf(415) > -1"
                            label="生产许可证" prop="produceLicense">


                        <UnloadImg
                                :list="produceLicenseList"
                                :onSuccess="handleproduceLicenseUploadSuccess"
                                @update="produceLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1 || this.bigTypes.indexOf(61) > -1|| this.bigTypes.indexOf(46) > -1|| this.bigTypes.indexOf(55) > -1|| this.bigTypes.indexOf(415) > -1"
                            label="经营许可证" prop="manageLicense">


                        <UnloadImg
                                :list="manageLicenseList"
                                :onSuccess="handlemanageLicenseUploadSuccess"
                                @update="manageLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(47) > -1||this.bigTypes.indexOf(42) > -1||this.bigTypes.indexOf(46) > -1||this.bigTypes.indexOf(55) > -1"
                            label="备案登记" prop="manageLicense">


                        <UnloadImg
                                :list="recordTableList"
                                :onSuccess="handlerecordTableUploadSuccess"
                                @update="recordTableList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if="this.bigTypes.length > 0" label="销售授权书" prop="manageLicense">


                        <UnloadImg
                                :list="salesAuthorizationList"
                                :onSuccess="handlesalesAuthorizationUploadSuccess"
                                @update="salesAuthorizationList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if="this.bigTypes.indexOf(61) > -1||this.bigTypes.indexOf(415) > -1" label="产品加工协议"
                                  prop="manageLicense">


                        <UnloadImg
                                :list="productAgreementList"
                                :onSuccess="handleproductAgreementUploadSuccess"
                                @update="productAgreementList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>

                    <el-form-item v-if="this.bigTypes.indexOf(60) > -1" label="保健食品GMP证书" prop="gmpLicense">


                        <UnloadImg
                                :list="gmpLicenseList"
                                :onSuccess="handlegmpLicenseUploadSuccess"
                                @update="gmpLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if="this.bigTypes.length > 0" label="商标注册证">


                        <UnloadImg
                                :list="trademarkLicenseList"
                                :onSuccess="handletrademarkLicenseUploadSuccess"
                                @update="trademarkLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if=" this.bigTypes.indexOf(54) > -1 || this.bigTypes.indexOf(44) > -1|| this.bigTypes.indexOf(48) > -1|| this.bigTypes.indexOf(58) > -1|| this.bigTypes.indexOf(42) > -1|| this.bigTypes.indexOf(46) > -1
|| this.bigTypes.indexOf(52) > -1|| this.bigTypes.indexOf(53) > -1|| this.bigTypes.indexOf(57) > -1"
                                  label="成品检测报告（由国家认定的具有CNAS与CMA资质的第三方质检机构出具的检测报告）">


                        <UnloadImg
                                :list="goodsProveList"
                                :onSuccess="handlegoodsProveUploadSuccess"
                                @update="goodsProveList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if=" this.bigTypes.indexOf(41) > -1" label="非特殊用途化妆品备案">


                        <UnloadImg
                                :list="recordTableList"
                                :onSuccess="handlerecordTableUploadSuccess"
                                @update="recordTableList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(47) > -1|| this.bigTypes.indexOf(415) > -1"
                            label="商品质量保证书">


                        <UnloadImg
                                :list="qualityGuarantyList"
                                :onSuccess="handlequalityGuarantyUploadSuccess"
                                @update="qualityGuarantyList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if=" this.bigTypes.indexOf(54) > -1 || this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(41) > -1"
                            label="完整的销售授权">


                        <UnloadImg
                                :list="salesAuthorizationList"
                                :onSuccess="handlesalesAuthorizationUploadSuccess"
                                @update="salesAuthorizationList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if=" this.bigTypes.length > 0" label="进口货物报关单复印件（若经营进口商品，需提交该品牌中华人民共和国）">


                        <UnloadImg
                                :list="goodsDeclarationList"
                                :onSuccess="handlegoodsDeclarationUploadSuccess"
                                @update="goodsDeclarationList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if="this.bigTypes.indexOf(41) > -1||this.bigTypes.indexOf(55) > -1"
                                  label="入境货物检验检疫证明（若经营进口商品，需提交该品牌中华人民共和国）">


                        <UnloadImg
                                :list="testProveList"
                                :onSuccess="handletestProveUploadSuccess"
                                @update="testProveList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(47) > -1 || this.bigTypes.indexOf(44) > -1"
                            label="产品加工协议">

                        <UnloadImg
                                :list="productAgreementList"
                                :onSuccess="handleproductAgreementUploadSuccess"
                                @update="productAgreementList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1 || this.bigTypes.indexOf(61) > -1  || this.bigTypes.indexOf(415) > -1"
                            label="食品流通许可证">

                        <UnloadImg
                                :list="circulateLicenseList"
                                :onSuccess="handlecirculateLicenseUploadSuccess"
                                @update="circulateLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(60) > -1 ||this.bigTypes.indexOf(61) > -1 || this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(47) > -1|| this.bigTypes.indexOf(415) > -1"
                            label="产品检测报告">

                        <UnloadImg
                                :list="detectPhotocopyList"
                                :onSuccess="handledetectPhotocopyUploadSuccess"
                                @update="detectPhotocopyList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(60) > -1|| this.bigTypes.indexOf(55) > -1"
                            label="产品清单(若经营进口货物需提供,产品清单需与报关单产品保持一致性)">

                        <UnloadImg
                                :list="productListList"
                                :onSuccess="handleproductListUploadSuccess"
                                @update="productListList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if="this.bigTypes.indexOf(60) > -1" label="进口保健食品批准证书(若经营进口货物需提供)">

                        <UnloadImg
                                :list="approveLicenseList"
                                :onSuccess="handleapproveLicenseUploadSuccess"
                                @update="approveLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(60) > -1||this.bigTypes.indexOf(46) > -1||this.bigTypes.indexOf(55) > -1"
                            label="委托加工协议">

                        <UnloadImg
                                :list="entrustAgreementList"
                                :onSuccess="handleentrustAgreementUploadSuccess"
                                @update="entrustAgreementList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if="this.bigTypes.indexOf(41) > -1" label="化妆品生产企业卫生许可证">

                        <UnloadImg
                                :list="companyHealthLicenseList"
                                :onSuccess="handlecompanyhealthLicenseUploadSuccess"
                                @update="companyHealthLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item
                            v-if="this.bigTypes.indexOf(41) > -1 ||this.bigTypes.indexOf(58) > -1||this.bigTypes.indexOf(42) > -1||this.bigTypes.indexOf(55) > -1"
                            label="全国工业生产许可证">


                        <UnloadImg
                                :list="industryLicenseList"
                                :onSuccess="handleindustryLicenseUploadSuccess"
                                @update="industryLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item><!--
                <el-form-item v-if="this.bigTypes.indexOf(45) > -1" label="国产花露水、驱虫产品、蚊香、杀蟑胶饵产品需提供农药产品生产许可证或全国工业生产许可证（农药产品和农药登记证（或者农药临时登记证）、生产单位营业执照">

                    <el-upload
                            ref="companybusImgUpload"
                            action="http://upload.qiniup.com"
                            :auto-upload="true"
                            list-type="picture-card"
                            :on-preview="handlePictureCardPreview"
                            :before-upload="handleUpload"
                            :on-success="handlecompanybusImgUploadSuccess"
                            :data="qData"
                            :file-list="companybusImgList"
                            :on-remove="handlecompanybusImgRemove">
                        <i class="el-icon-plus"></i>
                    </el-upload>
                </el-form-item>-->
                    <!--   <el-form-item v-if="this.bigTypes.indexOf(45) > -1" label="国产餐具洗涤剂、清洁剂、保鲜膜等需提供全国工业生产许可证、生产商营业执照">

                           <el-upload
                                   ref="companybusImgUpload"
                                   action="http://upload.qiniup.com"
                                   :auto-upload="true"
                                   list-type="picture-card"
                                   :on-preview="handlePictureCardPreview"
                                   :before-upload="handleUpload"
                                   :on-success="handlecompanybusImgUploadSuccess"
                                   :data="qData"
                                   :file-list="companybusImgList"
                                   :on-remove="handlecompanybusImgRemove">
                               <i class="el-icon-plus"></i>
                           </el-upload>
                       </el-form-item>
                       <el-form-item v-if="this.bigTypes.indexOf(45) > -1" label="首次进口的消毒剂和消毒器械产品须提供针对具体产品型号的《卫生许可批件》">

                           <el-upload
                                   ref="companybusImgUpload"
                                   action="http://upload.qiniup.com"
                                   :auto-upload="true"
                                   list-type="picture-card"
                                   :on-preview="handlePictureCardPreview"
                                   :before-upload="handleUpload"
                                   :on-success="handlecompanybusImgUploadSuccess"
                                   :data="qData"
                                   :file-list="companybusImgList"
                                   :on-remove="handlecompanybusImgRemove">
                               <i class="el-icon-plus"></i>
                           </el-upload>
                       </el-form-item>-->
                    <!-- <el-form-item v-if="this.bigTypes.indexOf(45) > -1 && this.bigTypes.indexOf(124) > -1" label="全国工业产品生产许可证或者牙膏生产企业卫生许可证、生产单位营业执照">

                         <el-upload
                                 ref="companybusImgUpload"
                                 action="http://upload.qiniup.com"
                                 :auto-upload="true"
                                 list-type="picture-card"
                                 :on-preview="handlePictureCardPreview"
                                 :before-upload="handleUpload"
                                 :on-success="handlecompanybusImgUploadSuccess"
                                 :data="qData"
                                 :file-list="companybusImgList"
                                 :on-remove="handlecompanybusImgRemove">
                             <i class="el-icon-plus"></i>
                         </el-upload>
                     </el-form-item>-->

                    <!--<el-form-item v-if="this.bigTypes.indexOf(45) > -1" label="具有抑菌、抗菌、杀菌功能的洗手液、消毒液(剂)等（消毒产品生产企业卫生许可证、生产单位营业执照）">

                        <el-upload
                                ref="companybusImgUpload"
                                action="http://upload.qiniup.com"
                                :auto-upload="true"
                                list-type="picture-card"
                                :on-preview="handlePictureCardPreview"
                                :before-upload="handleUpload"
                                :on-success="handlecompanybusImgUploadSuccess"
                                :data="qData"
                                :file-list="companybusImgList"
                                :on-remove="handlecompanybusImgRemove">
                            <i class="el-icon-plus"></i>
                        </el-upload>
                    </el-form-item>-->
                    <el-form-item
                            v-if="this.bigTypes.indexOf(45) > -1 || this.bigTypes.indexOf(44) > -1|| this.bigTypes.indexOf(48) > -1|| this.bigTypes.indexOf(58) > -1|| this.bigTypes.indexOf(42) > -1|| this.bigTypes.indexOf(55) > -1|| this.bigTypes.indexOf(43) > -1"
                            label="CCC认证证书">

                        <UnloadImg
                                :list="cccLicenseList"
                                :onSuccess="handlecccLicenseUploadSuccess"
                                @update="cccLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if="this.bigTypes.indexOf(61) > -1" label="动物防疫条件合格证、动物检验检疫、农产品卫生检疫合格证明">

                        <UnloadImg
                                :list="epidemicPreventionList"
                                :onSuccess="handleepidemicPreventionUploadSuccess"
                                @update="epidemicPreventionList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <!--                <el-form-item v-if="this.bigTypes.indexOf(61) > -1 || this.bigTypes.indexOf(60) > -1" label="产品检测报告">-->
                    <!--                   -->
                    <!--                    <el-upload-->
                    <!--                            ref="detectPhotocopyUpload"-->
                    <!--                            action="http://upload.qiniup.com"-->
                    <!--                            :auto-upload="true"-->
                    <!--                            list-type="picture-card"-->
                    <!--                            :on-preview="handlePictureCardPreview"-->
                    <!--                            :before-upload="handleUpload"-->
                    <!--                            :on-success="handledetectPhotocopyUploadSuccess"-->
                    <!--                            :data="qData"-->
                    <!--                            :file-list="detectPhotocopyList"-->
                    <!--                            :on-remove="handledetectPhotocopyRemove">-->
                    <!--                        <i class="el-icon-plus"></i>-->
                    <!--                    </el-upload>-->
                    <!--                </el-form-item>-->
                    <!--   <el-form-item v-if="this.bigTypes.indexOf(61) > -1 || this.bigTypes.indexOf(60) > -1" label="食品流通许可证或食品经营许可证">

                           <el-upload
                                   ref="companybusImgUpload"
                                   action="http://upload.qiniup.com"
                                   :auto-upload="true"
                                   list-type="picture-card"
                                   :on-preview="handlePictureCardPreview"
                                   :before-upload="handleUpload"
                                   :on-success="handlecompanybusImgUploadSuccess"
                                   :data="qData"
                                   :file-list="companybusImgList"
                                   :on-remove="handlecompanybusImgRemove">
                               <i class="el-icon-plus"></i>
                           </el-upload>
                       </el-form-item>-->
                    <el-form-item v-if="this.bigTypes.indexOf(60) > -1 || this.bigTypes.indexOf(47) > -1"
                                  label="品牌商的食品经营企业卫生许可证">

                        <UnloadImg
                                :list="manageHealthLicenseList"
                                :onSuccess="handlemanagehealthLicenseUploadSuccess"
                                @update="manageHealthLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>
                    <el-form-item v-if="this.bigTypes.indexOf(60) > -1" label="生产厂商的企业营业执照副本复印件(非生产厂商)">

                        <UnloadImg
                                :list="companyLicenseList"
                                :onSuccess="handlecompanyLicenseUploadSuccess"
                                @update="companyLicenseList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                    </el-form-item>

                    <!--  <el-form-item v-if="this.bigTypes.indexOf(61) > -1 || this.bigTypes.indexOf(41) > -1 || this.bigTypes.indexOf(60) > -1" label="商标注册证复印件或商标注册受理通知书">

                          <el-upload
                                  ref="companybusImgUpload"
                                  action="http://upload.qiniup.com"
                                  :auto-upload="true"
                                  list-type="picture-card"
                                  :on-preview="handlePictureCardPreview"
                                  :before-upload="handleUpload"
                                  :on-success="handlecompanybusImgUploadSuccess"
                                  :data="qData"
                                  :file-list="companybusImgList"
                                  :on-remove="handlecompanybusImgRemove">
                              <i class="el-icon-plus"></i>
                          </el-upload>
                      </el-form-item>-->
                    <!--      <el-form-item v-if="this.bigTypes.indexOf(41) > -1" label="进口非特化妆品备案">

                              <el-upload
                                      ref="companybusImgUpload"
                                      action="http://upload.qiniup.com"
                                      :auto-upload="true"
                                      list-type="picture-card"
                                      :on-preview="handlePictureCardPreview"
                                      :before-upload="handleUpload"
                                      :on-success="handlecompanybusImgUploadSuccess"
                                      :data="qData"
                                      :file-list="companybusImgList"
                                      :on-remove="handlecompanybusImgRemove">
                                  <i class="el-icon-plus"></i>
                              </el-upload>
                          </el-form-item>-->
                    <!--             <el-form-item v-if="this.bigTypes.indexOf(60) > -1" label="营业执照(应有生产经营保健品或预包装经营范围)">

                                     <el-upload
                                             ref="companybusImgUpload"
                                             action="http://upload.qiniup.com"
                                             :auto-upload="true"
                                             list-type="picture-card"
                                             :on-preview="handlePictureCardPreview"
                                             :before-upload="handleUpload"
                                             :on-success="handlecompanybusImgUploadSuccess"
                                             :data="qData"
                                             :file-list="companybusImgList"
                                             :on-remove="handlecompanybusImgRemove">
                                         <i class="el-icon-plus"></i>
                                     </el-upload>
                                 </el-form-item>-->
                    <el-form-item label="品牌方承诺书或授权书">
                        <UnloadImg
                                :list="brandAuthorizationList"
                                :onSuccess="handlebrandAuthorizationUploadSuccess"
                                @update="brandAuthorizationList=$event"
                                @showImg="handlePictureCardPreview"
                                :token="qData.token"
                        ></UnloadImg>
                        <a href="http://images.zmzpl.com/品牌方承诺书模板.docx" style="text-decoration:underline;color: blue">品牌承诺书模板.docx下载</a>
                        <a href="http://images.zmzpl.com/授权书模板.docx" style="text-decoration:underline;color: blue;margin-left: 20px">授权书模板.docx下载</a>
                    </el-form-item>
                <el-form-item label="产品缩略图">
                    <UnloadImg
                            :list="imgList"
                            :onSuccess="handleimgUploadSuccess"
                            @update="imgList=$event"
                            @showImg="handlePictureCardPreview"
                            :token="qData.token"
                    ></UnloadImg>
                    <div class="uploadImg">最多上传1张400*400的图片</div>
                </el-form-item>
                <el-form-item label="产品主图">
                    <UnloadImg
                            :list="midImgList"
                            :onSuccess="handlemidImgUploadSuccess"
                            @update="midImgList=$event"
                            @showImg="handlePictureCardPreview"
                            :token="qData.token"
                    ></UnloadImg>
                    <div class="uploadImg">最多上传5张800*800的图片</div>
                </el-form-item>
                <el-form-item label="产品详情图">
                    <UnloadImg
                            :limit="5"
                            :list="bigImgList"
                            :onSuccess="handlebigImgUploadSuccess"
                            @update="bigImgList=$event"
                            @showImg="handlePictureCardPreview"
                            :token="qData.token"
                    ></UnloadImg>
                    <div class="uploadImg">上传1-3个,宽度750,高度不限,总大小不超过1M</div>
                </el-form-item>
                </div>
                <el-dialog :visible.sync="dialogVisible" append-to-body>
                    <img width="100%" :src="dialogImageUrl" alt="">
                </el-dialog>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="closeDialogForm">取消</el-button>
                <el-button v-if="dialogStatus=='create'" type="primary" @click="createData">确认</el-button>
                <el-button v-else type="primary" @click="updateData">确认</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<style type="stylus" lang="stylus">
    .filter-container {
        /*padding-bottom: 20px;*/
    }

    .filter-item {
        margin-bottom: 10px;
    }

    .filter-item.input {
        /*line-height: 60px*/
        margin-right: 10px;
    }

    .uploadImg {
        color: red;
        font-size: 12px
    }
    .imgNewDiv{
        pointer-events none
    }
</style>

<script>
    import UnloadImg from '@/components/UnloadImg'
    import {list, save, update, remove, info, updateStock, listType} from '@/api/mall_goods'
    import waves from '@/directive/waves' // 水波纹指令
    import {getList} from '@/api/shopLogTem'

    import {getToken, domain} from '@/api/qiniu'
    import {listToStrs, strsToList} from '@/utils/imgUtil'

    import {mapGetters} from 'vuex'
    import {hasAuth} from '@/utils/auth'
    import Sku from '@/components/Sku'
    import {listAll} from "../../../api/level";

    export default {
        name: 'test',
        directives: {
            waves
        },
        components: {
            Sku,UnloadImg
        },
        data() {
            return {
                priceFlag:false,
                shopReward:null,
                cashReward:null,
                voucherReward:null,
                clearReward:null,
                couponReward:null,
                supplyPrice:null,
                maxCoupon:null,
                maxClear:null,
                shopLogTemList:[],
                shopLogTems:["新增物流模板"],
                brandBusinessLicenseList: [],
                companyHealthLicenseList: [],
                manageHealthLicenseList: [],
                approveLicenseList: [],
                produceLicenseList: [],
                registerNoticeList: [],
                manageLicenseList: [],
                gmpLicenseList: [],
                trademarkLicenseList: [],
                productAgreementList: [],
                circulateLicenseList: [],
                betweenCirculateLicenseList: [],
                detectPhotocopyList: [],
                goodsDeclarationList: [],
                productListList: [],
                companyLicenseList: [],
                entrustAgreementList: [],
                qualityGuarantyList: [],
                healthPhotocopyList: [],
                fiveTrademarkList: [],
                recordTableList: [],
                epidemicPreventionList: [],
                industryLicenseList: [],
                salesAuthorizationList: [],
                testProveList: [],
                cccLicenseList: [],
                goodsProveList: [],
                brandAuthorizationList: [],
                bigTypes: [],
                userId: null,
                levels: null,
                tableKey: 0,
                list: null,
                total: null,
                listLoading: true,
                props: {multiple: true, label: "name", value: "id"},
                queryProp: {label: "name", value: "id"},
                mallTypes: [],
                fenLeiTypes: [],
                types: [],
                roleId: [],
                province: null,
                city: null,
                area: null,
                adjustFlag:false,
                saleTypeFlag:false,
                act: {
                    id: null,
                    name: null,
                    goodsId: null,
                    bindGoodsId: null,
                    bindGoodsQuantity: null,
                    skuId: null,
                    start: null,
                    end: null,
                    level: null,
                    number: null,
                    stock: null,
                    status: null
                },
                goodsTemp: {
                    id: null,
                    userId: null,
                    goodsId: null,
                    brandName: null,
                    brandInfo: null,
                    brandBusinessLicense: null,
                    companyHealthLicense: null,
                    manageHealthLicense: null,
                    approveLicense: null,
                    produceLicense: null,
                    registerNotice: null,
                    manageLicense: null,
                    gmpLicense: null,
                    trademarkLicense: null,
                    productAgreement: null,
                    circulateLicense: null,
                    betweenCirculateLicense: null,
                    detectPhotocopy: null,
                    goodsDeclaration: null,
                    productList: null,
                    companyLicense: null,
                    entrustAgreement: null,
                    qualityGuaranty: null,
                    healthPhotocopy: null,
                    fiveTrademark: null,
                    recordTable: null,
                    epidemicPrevention: null,
                    industryLicense: null,
                    salesAuthorization: null,
                    testProve: null,
                    cccLicense: null,
                    goodsProve: null,
                    brandAuthorization: null
                },
                listQuery: {
                    page: 1,
                    limit: 20,
                    order: 'sort'
                    ,
                    userId: null
                    ,
                    types: [],

                    type: null
                    ,
                    name: null
                    ,
                    unit: null
                    ,
                    sales: null
                    ,
                    weight: null
                    ,
                    info: null
                    ,
                    title: null
                    ,
                    oldPrice: null
                    ,
                    nowPrice: null
                    , shopPrice: null
                    ,
                    profit: null
                    ,
                    sort: null
                    ,
                    stock: null
                    ,
                    openSku: null
                    ,
                    shelf: null,
                    mode: null,
                    saleType: null,
                    shopName: null
                },
                adminSaleTypeOptions: ["分享有利", "代理有利", "新品体验", "复购折扣", "12元包邮", "门店采购", "营销工具", "", "", "", "", "", "", "", "", "", "", "清货", "聚优惠"],
                saleTypeOptions: ["分享有利", "代理有利", "新品体验", "", "", "门店采购","", "", "", "", "", "", "", "", "", "", "", "清货",],

                options: ["否", "是"],
                openSkuOptions: ["关闭", "开启"],
                dailySelOptions: ["关闭", "开启"],
                goodsShareOptions: ["活动信息", "卖点信息","关闭"],
                shelfOptions: ["下架", "上架"],
                userShelfOptions: ["下架","","上架审核"],
                adminShelfOptions: ["下架", "上架","待审核"],
                logTypeOptions: ["包邮", "满免", "计重"],
                tagTypes: ['info', '', 'warning', 'danger', 'warning'],
                stock: {
                    goodsId: null,
                    goodsName: null,
                    oldQuantity: null,
                    quantity: null,
                    remark: null,
                    skuName: null
                },
                saleTypeInfoEntity: {
                    id:null,
                    goodsId:null,
                    maxCoupon: null,
                    maxClear:null,
                    point: null,
                    transfer: null,
                    delivery: null,
                    couponReward: null,
                    voucherReward: null,
                    maxVoucher: null,
                    managerReward: null,
                    clearReward: null
                },
                flTypes: [],
                goodsShare:null,
                remnant: 200,//备注最大输入200个字符
                maxRemnant: 200,//备注最大输入200个字符
                shopPrice:null,
                temp:
                    {
                        id: null,
                        userId: null,
                        type: null,
                        name: null,
                        unit: null,
                        sales: null,
                        weight: null,
                        perBox: null,
                        info: null,
                        title: null,
                        oldPrice: null,
                        nowPrice: null,
                        shopPrice: null,
                        profit: null,
                        openSku: null,
                        img: null,
                        bigImg: null,
                        shelf: null,
                        sort: null,
                        expDate: null,
                        logType: null,
                        fullNumber: null,
                        logFee: null,
                        stock: null,
                        midImg: null,
                        postImg: null,
                        prices: [],
                        saleType: null,
                        createTime: null,
                        guaranty: null,
                        discountInfo:null,
                        discountPrice:null,
                        actInfo:null,
                        buyTheme:null,
                        buyInfo:null,
                        logTemId:null,
                        dailySel:null,
                        supplyPrice:null
                    },
                dialogFormVisible: false,
                dialogStockVisible: false,
                dialogStatus:
                    '',
                textMap:
                    {
                        update: '修改',
                        create:
                            '新增'
                    }
                ,
                // 存在图片
                dialogImageUrl: '',
                dialogVisible: false,
                imgList: [],
                bigImgList: [],
                midImgList: [],
                postImgList: [],
                imgDiv: 'imgDiv',
                rules:
                    {
                        cash_reward: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],

                        voucher_reward: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        logType: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        userId: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        expDate: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        type: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        name: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        createTime: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        transfer: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        delivery: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        saleType: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        unit: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        sales: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        weight: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        info: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        title: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        oldPrice: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        shopPrice: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        nowPrice: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        profit: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        openSku: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'blur'
                            }
                        ]
                        ,
                        img: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        bigImg: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        shelf: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'blur'
                            }
                        ],

                        sort: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        stock: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        guaranty: [
                            {
                                required: true, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                        ,
                        midImg: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        postImg: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        brandName: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ],
                        brandInfo: [
                            {
                                required: false, message:
                                    '必填字段', trigger:
                                    'change'
                            }
                        ]
                    }
                ,
                downloadLoading: false,
                qData:
                    {
                        token: '',
                        key:
                            ''
                    }
            }
        },
        created() {

            this.getList()
            this.getShopLogTemList()
            //获取所有级别
            listAll().then(res => {
                this.levels = res.data
            })
            //获取所有的分类
            listType().then(res => {
                this.mallTypes = res.data
            })
        },
        computed: {
            getShopName(){
                return process.env.VUE_APP_SHOPNAME;
            },
            isWg(){
                return process.env.VUE_APP_SHOPNAME == '五集时代';
            },
            ...mapGetters([
                'perms'
            ]),
            canSave() {
                return hasAuth(this.perms, 'mall:wares:save')
            },
            canDelete() {
                return hasAuth(this.perms, 'mall:wares:delete')
            },
            canUpdate() {
                return hasAuth(this.perms, 'mall:wares:update')
            },
            canList() {
                return hasAuth(this.perms, 'mall:wares:list')
            }
        },
        methods: {
            descInput(){
                var txtVal = this.temp.info.length;
                this.remnant = this.maxRemnant - txtVal;
            },
            selectPrice(index){
                this.cashReward = null
                this.voucherReward = null
                this.couponReward = null
                this.maxCoupon = null
                this.maxClear=null
                this.voucherReward = null
                this.temp.supplyPrice= null
                this.shopPrice= null
                this.temp.shopPrice = null
                this.saleTypeInfoEntity.cashReward = null
                this.saleTypeInfoEntity.voucherReward = null
                this.saleTypeInfoEntity.couponReward = null
                this.saleTypeInfoEntity.maxCoupon = null
                this.saleTypeInfoEntity.maxClear=null
                this.saleTypeInfoEntity.voucherReward = null
                if (oldIndex == 5){
                    this.cashReward = this.shopPrice?this.shopPrice * 0.1:null;
                    this.voucherReward = this.shopPrice?this.shopPrice * 0.1:null;
                }
            },
            getShopLogTemList() {
                getList().then(res => {
                    this.shopLogTemList = res.data
                })
            },
            selectChange(){
                this.$router.push({ path: '/bus/logTemplate', query: {}})
            },
            handleact(){
                if (this.goodsShare != null && this.goodsShare != ""&&this.goodsShare == 0){
                    this.temp.buyTheme = null;
                    this.temp.buyInfo = null;
                }
                if (this.goodsShare != null && this.goodsShare != ""&&this.goodsShare == 1){
                    this.temp.discountInfo = null;
                    this.temp.discountPrice = null;
                    this.temp.actInfo = null;
                }
                if (this.goodsShare != null && this.goodsShare != ""&&this.goodsShare == 2){
                    this.temp.discountInfo = null;
                    this.temp.discountPrice = null;
                    this.temp.actInfo = null;
                    this.temp.buyTheme = null;
                    this.temp.buyInfo = null;
                }
            },

            changeStockSku(name) {

                this.temp.mallSkus.forEach(sku => {

                    if (sku.name == name) {
                        this.stock.oldQuantity = sku.stock
                    }
                })
            },
            updateSku(themeList, skuList) {
                this.temp.skuThemes = themeList
                this.temp.mallSkus = skuList
            },
            getList() {
                this.listLoading = true
                list(this.listQuery).then(response => {
                    this.list = response.data.list
                    this.total = response.data.total
                    this.userId = response.extra.userId
                    this.roleId = response.extra.roleId
                    if (this.userId != null){
                        this.priceFlag=true;
                    }
                    this.listLoading = false
                })
            },
            handleFilter() {
                this.listQuery.type = this.types[1];

                this.listQuery.page = 1
                this.getList()
            },
            handleSizeChange(val) {
                this.listQuery.limit = val
                this.getList()
            },
            handleCurrentChange(val) {
                this.listQuery.page = val
                this.getList()
            },
            handleModifyStatus(row, status) {
                this.$message({
                    message: '操作成功',
                    type: 'success'
                })
                row.status = status
            },
            beforeFormShow(row) {
                this.resetTemp(row) // 更新数据
                this.province = 1
                this.city = 2
                this.area = 3
                let initPrices = []
                this.fenLeiTypes = [];
                this.saleTypeInfoEntity = {};
                this.goodsTemp = {}
                this.bigTypes = [];
                this.shopReward = 5
                this.cashReward = null
                this.voucherReward = null
                this.clearReward = null
                this.maxClear = null
                this.maxCoupon = null
                this.couponReward = null
                this.goodsShare = null
                this.remnant = 200
                this.shopPrice = null
                this.act = {}
                // 初始化price
                this.levels.forEach(level => {
                    let price = {
                        levelId: level.id,
                        levelName: level.name,
                        price: null
                    }
                    initPrices.push(price)
                })
                this.temp.prices = initPrices;
                if (row) {
                    info(row.id).then(res => {
                        this.resetTemp(res.data)
                        if (res.extra.types){
                            this.fenLeiTypes = res.extra.types;
                        }
                        if (res.data.supplyPrice != null && res.data.supplyPrice != ''){
                            this.supplyPrice = res.data.supplyPrice
                        }
                        if (res.data.shopPrice != null && res.data.shopPrice != ''){
                            this.shopPrice = res.data.shopPrice
                        }
                        if(res.extra.act){
                            this.act = res.extra.act
                        }

                        if (this.fenLeiTypes != null && this.fenLeiTypes.length > 0) {
                            this.handleChange(this.fenLeiTypes)
                        }
                        if (this.temp.discountInfo != null && this.temp.discountInfo != ""){
                            this.goodsShare = 0;
                        }
                        if (this.temp.buyTheme != null && this.temp.buyTheme != ""){
                            this.goodsShare = 1;
                        }
                        if (res.extra.saleTypeInfoEntity == null) {
                            this.saleTypeInfoEntity.transfer = 0;
                            this.saleTypeInfoEntity.delivery = 0;
                        } else {
                            this.saleTypeInfoEntity = res.extra.saleTypeInfoEntity;
                        }

                        if (this.saleTypeInfoEntity.managerReward == null || this.saleTypeInfoEntity.managerReward == '') {
                            this.shopReward = 5
                        } else {
                            this.shopReward = this.saleTypeInfoEntity.managerReward * 100;
                        }
                        if (this.saleTypeInfoEntity.voucherReward != null && this.saleTypeInfoEntity.voucherReward != '') {
                            this.voucherReward = this.saleTypeInfoEntity.voucherReward.split("_")[1]
                        }
                        if (this.saleTypeInfoEntity.couponReward != null && this.saleTypeInfoEntity.couponReward != '') {
                            this.couponReward = this.saleTypeInfoEntity.couponReward.split("_")[1]
                        }
                        if (this.saleTypeInfoEntity.cashReward != null && this.saleTypeInfoEntity.cashReward != '') {
                            this.cashReward = this.saleTypeInfoEntity.cashReward.split("_")[1]
                        }
                        if (this.saleTypeInfoEntity.clearReward != null && this.saleTypeInfoEntity.clearReward != '') {
                            this.clearReward = this.saleTypeInfoEntity.clearReward.split("_")[1]
                        }
                        if (this.saleTypeInfoEntity.maxClear != null && this.saleTypeInfoEntity.maxClear != '') {
                            this.maxClear = this.saleTypeInfoEntity.maxClear
                        }
                        if (this.saleTypeInfoEntity.maxCoupon != null && this.saleTypeInfoEntity.maxCoupon != '') {
                            this.maxCoupon = this.saleTypeInfoEntity.maxCoupon
                        }
                        if (this.saleTypeInfoEntity.areaReward != null && this.saleTypeInfoEntity.areaReward != '') {
                            if (this.saleTypeInfoEntity.areaReward != '0_0_0') {
                                this.province = this.saleTypeInfoEntity.areaReward.split("_")[0]
                                this.city = this.saleTypeInfoEntity.areaReward.split("_")[1]
                                this.area = this.saleTypeInfoEntity.areaReward.split("_")[2]
                            } else {
                                this.province = 1
                                this.city = 2
                                this.area = 3
                            }
                        }

                        if (res.extra.goodsQualificationEntity) {
                            this.goodsTemp = res.extra.goodsQualificationEntity;
                        }
                        this.fenLeiTypes.forEach(item => {
                            if (!this.bigTypes.includes(item[0])) {
                                this.bigTypes.push(item[0])
                            }
                        })
                        this.temp.prices = initPrices
                        for (let i = 0; i < this.temp.prices.length; i++) {
                            for (let j = 0; j < res.data.prices.length; j++) {
                                if (this.temp.prices[i].levelId == res.data.prices[j].levelId) {
                                    this.temp.prices[i] = Object.assign(this.temp.prices[i], res.data.prices[j])
                                }
                            }
                        }
                        // 存在图片字段转换图片地址显示
                        this.initImgUrl()
                        this.dialogStatus = 'update'
                        this.dialogFormVisible = true;
                        this.$nextTick(() => {
                            this.$refs['dataForm'].clearValidate()
                        })
                    })
                }


                // 存在图片
                this.initQiniu()


            },
            afterFormShow(row) {

            },
            beforeFormCommit() {
                this.initImgName()// 图片转换
            },
            resetTemp(row) {
                if (row) {
                    this.temp = Object.assign({}, row) // copy obj
                    let num = this.temp.info  ?this.temp.info.length:0
                    this.remnant = this.maxRemnant - num
                } else {
                    this.temp = {prices: []}
                }

            },
            handleCreate() {
                this.beforeFormShow()
                // this.resetTemp()
                this.resetImgUrl()
                this.goodsShare = null
                this.shopPrice = null
                this.province = 1
                this.city = 2
                this.area = 3
                this.dialogStatus = 'create'
                this.dialogFormVisible = true
                this.$nextTick(() => {
                    this.afterFormShow()
                    this.$refs['dataForm'].clearValidate()
                })
            },
            handleAdjust(row){
                this.dialogStatus = 'adjust'
                this.adjustFlag = true
                this.saleTypeFlag = true
                this.imgDiv ="imgNewDiv"
                this.handleUpdate(row)
            },
            handleDelete(row) {
                this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    // this.$message({
                    //   type: 'success',
                    //   message: '删除成功!'
                    // })
                    this.deleteData([row.id])
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    })
                })
            },
            // 显示将图片名封装成可以展示状态集合
            initImgUrl() {
                this.imgList = strsToList(this.temp.img, domain)
                this.bigImgList = strsToList(this.temp.bigImg, domain)
                this.midImgList = strsToList(this.temp.midImg, domain)
                this.postImgList = strsToList(this.temp.postImg, domain)
                this.brandBusinessLicenseList = strsToList(this.goodsTemp.brandBusinessLicense, domain)
                this.companyHealthLicenseList = strsToList(this.goodsTemp.companyHealthLicense, domain)
                this.manageHealthLicenseList = strsToList(this.goodsTemp.manageHealthLicense, domain)
                this.approveLicenseList = strsToList(this.goodsTemp.approveLicense, domain)
                this.produceLicenseList = strsToList(this.goodsTemp.produceLicense, domain)
                this.registerNoticeList = strsToList(this.goodsTemp.registerNotice, domain)
                this.manageLicenseList = strsToList(this.goodsTemp.manageLicense, domain)
                this.gmpLicenseList = strsToList(this.goodsTemp.gmpLicense, domain)
                this.trademarkLicenseList = strsToList(this.goodsTemp.trademarkLicense, domain)
                this.productAgreementList = strsToList(this.goodsTemp.productAgreement, domain)
                this.circulateLicenseList = strsToList(this.goodsTemp.circulateLicense, domain)
                this.betweenCirculateLicenseList = strsToList(this.goodsTemp.betweenCirculateLicense, domain)
                this.detectPhotocopyList = strsToList(this.goodsTemp.detectPhotocopy, domain)
                this.goodsDeclarationList = strsToList(this.goodsTemp.goodsDeclaration, domain)
                this.productListList = strsToList(this.goodsTemp.productList, domain)
                this.companyLicenseList = strsToList(this.goodsTemp.companyLicense, domain)
                this.entrustAgreementList = strsToList(this.goodsTemp.entrustAgreement, domain)
                this.qualityGuarantyList = strsToList(this.goodsTemp.qualityGuaranty, domain)
                this.healthPhotocopyList = strsToList(this.goodsTemp.healthPhotocopy, domain)
                this.fiveTrademarkList = strsToList(this.goodsTemp.fiveTrademark, domain)
                this.recordTableList = strsToList(this.goodsTemp.recordTable, domain)
                this.epidemicPreventionList = strsToList(this.goodsTemp.epidemicPrevention, domain)
                this.industryLicenseList = strsToList(this.goodsTemp.industryLicense, domain)
                this.salesAuthorizationList = strsToList(this.goodsTemp.salesAuthorization, domain)
                this.testProveList = strsToList(this.goodsTemp.testProve, domain)
                this.cccLicenseList = strsToList(this.goodsTemp.cccLicense, domain)
                this.goodsProveList = strsToList(this.goodsTemp.goodsProve, domain)
                this.brandAuthorizationList = strsToList(this.goodsTemp.brandAuthorization, domain)
            },
            // 关闭显示窗口 重置图片地址 防止错乱
            resetImgUrl() {
                this.imgList = []
                this.bigImgList = []
                this.midImgList = []
                this.postImgList = []
                this.brandBusinessLicenseList = []
                this.companyHealthLicenseList = []
                this.manageHealthLicenseList = []
                this.approveLicenseList = []
                this.produceLicenseList = []
                this.registerNoticeList = []
                this.manageLicenseList = []
                this.gmpLicenseList = []
                this.trademarkLicenseList = []
                this.productAgreementList = []
                this.circulateLicenseList = []
                this.betweenCirculateLicenseList = []
                this.detectPhotocopyList = []
                this.goodsDeclarationList = []
                this.productListList = []
                this.companyLicenseList = []
                this.entrustAgreementList = []
                this.qualityGuarantyList = []
                this.healthPhotocopyList = []
                this.fiveTrademarkList = []
                this.recordTableList = []
                this.epidemicPreventionList = []
                this.industryLicenseList = []
                this.salesAuthorizationList = []
                this.testProveList = []
                this.cccLicenseList = []
                this.goodsProveList = []
                this.brandAuthorizationList = []

            },
            // 上传或者更新的时候从图片链接中获取图片名字
            initImgName() {
                this.temp.img = listToStrs(this.imgList)
                this.temp.bigImg = listToStrs(this.bigImgList)
                this.temp.midImg = listToStrs(this.midImgList)
                this.temp.postImg = listToStrs(this.postImgList)
                this.goodsTemp.brandBusinessLicense = listToStrs(this.brandBusinessLicenseList)
                this.goodsTemp.companyHealthLicense = listToStrs(this.companyHealthLicenseList)
                this.goodsTemp.manageHealthLicense = listToStrs(this.manageHealthLicenseList)
                this.goodsTemp.approveLicense = listToStrs(this.approveLicenseList)
                this.goodsTemp.produceLicense = listToStrs(this.produceLicenseList)
                this.goodsTemp.registerNotice = listToStrs(this.registerNoticeList)
                this.goodsTemp.manageLicense = listToStrs(this.manageLicenseList)
                this.goodsTemp.gmpLicense = listToStrs(this.gmpLicenseList)
                this.goodsTemp.trademarkLicense = listToStrs(this.trademarkLicenseList)
                this.goodsTemp.productAgreement = listToStrs(this.productAgreementList)
                this.goodsTemp.circulateLicense = listToStrs(this.circulateLicenseList)
                this.goodsTemp.betweenCirculateLicense = listToStrs(this.betweenCirculateLicenseList)
                this.goodsTemp.detectPhotocopy = listToStrs(this.detectPhotocopyList)
                this.goodsTemp.goodsDeclaration = listToStrs(this.goodsDeclarationList)
                this.goodsTemp.productList = listToStrs(this.productListList)
                this.goodsTemp.companyLicense = listToStrs(this.companyLicenseList)
                this.goodsTemp.entrustAgreement = listToStrs(this.entrustAgreementList)
                this.goodsTemp.qualityGuaranty = listToStrs(this.qualityGuarantyList)
                this.goodsTemp.healthPhotocopy = listToStrs(this.healthPhotocopyList)
                this.goodsTemp.fiveTrademark = listToStrs(this.fiveTrademarkList)
                this.goodsTemp.recordTable = listToStrs(this.recordTableList)
                this.goodsTemp.epidemicPrevention = listToStrs(this.epidemicPreventionList)
                this.goodsTemp.industryLicense = listToStrs(this.industryLicenseList)
                this.goodsTemp.salesAuthorization = listToStrs(this.salesAuthorizationList)
                this.goodsTemp.testProve = listToStrs(this.testProveList)
                this.goodsTemp.cccLicense = listToStrs(this.cccLicenseList)
                this.goodsTemp.goodsProve = listToStrs(this.goodsProveList)
                this.goodsTemp.brandAuthorization = listToStrs(this.brandAuthorizationList)
            },
            initData() {
                if (!this.temp.stock) {
                    this.temp.stock = 0
                }
            },
            createData() {
                this.$refs['dataForm'].validate((valid) => {
                        if (valid) {
                            this.beforeFormCommit()
                            this.temp['json'] = true
                            this.initData();
                            if (this.temp.saleType == 5){
                                if (this.cashReward == null || this.cashReward == ""){
                                    this.$message.error("代金券奖励为必填项");
                                    return;
                                }
                                if (this.voucherReward == null || this.voucherReward == ""){
                                    this.$message.error("换购券奖励为必填项");
                                    return;
                                }
                                if (this.cashReward < this.shopPrice *100 /1000){
                                    this.$message.error("代金券奖励不能小于采购价的10%");
                                    return;
                                }
                                if (this.voucherReward < this.shopPrice *100 /1000){
                                    this.$message.error("换购券奖励不能小于采购价的10%");
                                    return;
                                }
                            }
                            if (this.goodsShare != null && this.goodsShare == 0){
                                if (this.temp.discountInfo == null || this.temp.discountInfo == "" || this.temp.discountInfo.length > 4){
                                    this.$message.error("优惠描述只能是四个字以内")
                                    return;
                                }
                                if (this.temp.actInfo == null || this.temp.actInfo == "" || this.temp.actInfo.length > 8){
                                    this.$message.error("活动信息八个字内")
                                    return;
                                }
                            }
                            if (this.goodsShare != null && this.goodsShare == 1){
                                if (this.temp.buyTheme == null || this.temp.buyTheme == "" || this.temp.buyTheme.length > 4){
                                    this.$message.error("卖点主题四个字内")
                                    return;
                                }
                                if (this.temp.buyInfo == null || this.temp.buyInfo == "" || this.temp.buyInfo.length > 8){
                                    this.$message.error("卖点信息八个字内")
                                    return;
                                }
                            }
                            console.log(this.supplyPrice)
                            if (this.userId != null && this.userId != '') {
                                // if (this.goodsTemp.brandAuthorization == null || this.goodsTemp.brandAuthorization == "") {
                                //     this.$alert('请上传品牌方承诺书或授权书', {
                                //         confirmButtonText: '确定',
                                //     })
                                //     return;
                                // }
                                if (this.flTypes == null || this.fenLeiTypes.length == 0) {
                                    this.$message({
                                        showClose: true,
                                        message: '请填写分类',
                                        type: 'error'
                                    });
                                    return;
                                }
                                if (this.goodsTemp.brandName == null || this.goodsTemp.brandName == '') {
                                    this.$message.error("请填写品牌名称")
                                    return;
                                }
                                if (this.goodsTemp.brandInfo == null || this.goodsTemp.brandInfo == '') {
                                    this.$message.error("请填写品牌简介")
                                    return;
                                }
                                if (this.province == null || this.province == ''
                                    || this.city == null || this.city == ''
                                    || this.area == null || this.area == '') {
                                    this.$message.error("请填写区域服务津贴")
                                    return;
                                }
                                if (this.temp.logType == 2){
                                    if (this.temp.logTemId == null || this.temp.logTemId == '') {
                                        this.$message({
                                            showClose: true,
                                            message: '请选择物流模板',
                                            type: 'error'
                                        });
                                        return;
                                    }
                                }
                                if (this.shopReward < 5) {
                                    this.$message.error("店铺服务津贴不能少于5%");
                                    return;
                                }

                                if (this.temp.saleType == 1){
                                    if (this.supplyPrice == null || this.supplyPrice == ''){
                                        this.$message.error("请填写供货价")
                                        return;
                                    }else {
                                         this.temp.supplyPrice=this.supplyPrice
                                    }
                                }
                            }
                            if (this.temp.saleType == 17){
                                this.saleTypeInfoEntity.managerReward = null
                                this.saleTypeInfoEntity.areaReward = null
                                if (this.maxClear != null && this.maxClear != ''){
                                    this.saleTypeInfoEntity.maxClear = this.maxClear
                                }
                            }else {
                                this.saleTypeInfoEntity.maxClear = null
                                this.saleTypeInfoEntity.clearReward = null
                                this.saleTypeInfoEntity.managerReward = this.shopReward / 100
                                if (this.province != null && this.province != '') {
                                    this.saleTypeInfoEntity.areaReward = this.province
                                }
                                if (this.city != null && this.city != '') {
                                    this.saleTypeInfoEntity.areaReward = this.saleTypeInfoEntity.areaReward + "_" + this.city
                                }
                                if (this.area != null && this.area != '') {
                                    this.saleTypeInfoEntity.areaReward = this.saleTypeInfoEntity.areaReward + "_" + this.area
                                }
                                if (this.voucherReward != null && this.voucherReward != '') {
                                    this.saleTypeInfoEntity.voucherReward = "0_" + this.voucherReward
                                }
                                if (this.couponReward != null && this.couponReward != '') {
                                    this.saleTypeInfoEntity.couponReward = "0_" + this.couponReward
                                }
                                if (this.cashReward != null && this.cashReward != '') {
                                    this.saleTypeInfoEntity.cashReward = "0_" + this.cashReward
                                }
                                if (this.maxCoupon != null && this.maxCoupon != ''){
                                    this.saleTypeInfoEntity.maxCoupon = this.maxCoupon
                                }

                            }
                            if (this.shopPrice != null &&  this.shopPrice != ''){
                                this.temp.shopPrice = this.shopPrice
                            }
                            if (this.clearReward != null && this.clearReward != '') {
                                this.saleTypeInfoEntity.clearReward = "0_" + this.clearReward
                            }
                            save(this.temp, this.saleTypeInfoEntity, this.flTypes, this.goodsTemp,this.act).then(res => {
                                this.temp = res.data
                                this.list.unshift(this.temp)
                                this.closeDialogForm()
                                this.$notify({
                                    title: '成功',
                                    message: '创建成功',
                                    type: 'success',
                                    duration: 2000
                                })
                            })
                        }
                    }
                )
            },
            deleteData(ids) {
                // const ids = [this.temp.id]
                remove({ids: ids}).then(res => {
                    // 从当前队列中移除
                    for (const v of this.list) {
                        if (ids.indexOf(v.id) > -1) {
                            const index = this.list.indexOf(v)
                            this.list.splice(oldIndex, 1)
                            break
                        }
                    }
                    this.$notify({
                        title: '成功',
                        message: '删除成功',
                        type: 'success',
                        duration: 2000
                    })
                })
            },
            handleStock(scope) {
                this.$index = scope.$index
                info(scope.row.id).then(res => {
                    this.temp = Object.assign({}, res.data)
                    this.stock.goodsName = this.temp.name
                    this.stock.goodsId = this.temp.id
                    this.stock.quantity = 0
                    this.stock.remark = ""
                    this.stock.skuName = ""
                    this.stock.oldQuantity = this.temp.quantity ? this.temp.quantity : 0
                    this.dialogStockVisible = true
                })


            },
            updateStock() {
                updateStock(this.stock).then(res => {
                    this.dialogStockVisible = false
                    this.$notify({
                        title: '成功',
                        message: '修改库存成功',
                        type: 'success',
                        duration: 2000
                    })
                    this.list.splice(this.$index, 1, res.data)
                })
            },
            handleUpdate(row) {

                this.beforeFormShow(row)
                if (this.userId!=null){
                    this.saleTypeFlag = true
                }

            },
            handleChange(value) {
                this.flTypes = value;
                let fl = [];
                let bigTypes = [];
                this.flTypes.forEach(item => {
                    fl.push(item[1])
                    bigTypes.push(item[0])
                })
                this.flTypes = fl;
                this.bigTypes = bigTypes
            },
            updateData() {
                this.$refs['dataForm'].validate((valid) => {
                    console.log(this.temp.shelf)
                        if (valid) {

                            this.beforeFormCommit()
                            if (this.temp.saleType == 5){
                                if (this.cashReward == null || this.cashReward == ""){
                                    this.$message.error("代金券奖励为必填项");
                                    return;
                                }
                                if (this.voucherReward == null || this.voucherReward == ""){
                                    this.$message.error("换购券奖励为必填项");
                                    return;
                                }
                                if (this.cashReward < this.shopPrice *100 /1000){
                                    this.$message.error("代金券奖励不能小于采购价的10%");
                                    return;
                                }
                                if (this.voucherReward < this.shopPrice *100 /1000){
                                    this.$message.error("换购券奖励不能小于采购价的10%");
                                    return;
                                }
                            }
                            if(this.goodsShare != null && this.goodsShare == 0){

                                if (this.temp.discountInfo == null || this.temp.discountInfo == "" || this.temp.discountInfo.length > 4){
                                    this.$message.error("优惠描述只能是四个字以内")
                                    return;
                                }
                                if (this.temp.actInfo == null || this.temp.actInfo == "" || this.temp.actInfo.length > 8){
                                    this.$message.error("活动信息八个字内")
                                    return;
                                }
                                this.temp.buyTheme = ""
                                this.temp.buyInfo = ""
                            }
                            if(this.goodsShare != null && this.goodsShare == 1){
                                if (this.temp.buyTheme == null || this.temp.buyTheme == "" || this.temp.buyTheme.length > 4){
                                    this.$message.error("卖点主题四个字内")
                                    return;
                                }
                                if (this.temp.buyInfo == null || this.temp.buyInfo == "" || this.temp.buyInfo.length > 8){
                                    this.$message.error("卖点信息八个字内")
                                    return;
                                }
                                this.temp.discountInfo = "";
                                this.temp.discountPrice = 0;
                                this.temp.actInfo = "";
                            }
                            if (this.goodsShare != null && this.goodsShare!=''&& this.goodsShare == 2){
                                this.temp.discountInfo = "";
                                this.temp.discountPrice = 0;
                                this.temp.actInfo = "";
                                this.temp.buyTheme = ""
                                this.temp.buyInfo = ""
                            }

                            if (this.userId != null) {
                                // if (this.goodsTemp.brandAuthorization == null || this.goodsTemp.brandAuthorization == "") {
                                //     this.$alert('请上传品牌方承诺书或授权书', {
                                //         confirmButtonText: '确定',
                                //     })
                                //     return;
                                // }
                                if (this.flTypes == null || this.fenLeiTypes.length == 0) {
                                    this.$message({
                                        showClose: true,
                                        message: '请填写分类',
                                        type: 'error'
                                    });
                                    return;
                                }
                                if (this.temp.logType == 2){
                                    if (this.temp.logTemId == null || this.temp.logTemId == '') {
                                        this.$message({
                                            showClose: true,
                                            message: '请选择物流模板',
                                            type: 'error'
                                        });
                                        return;
                                    }
                                }

                                if (this.goodsTemp.brandName == null || this.goodsTemp.brandName == '') {
                                    this.$message.error("请填写品牌名称")
                                    return;
                                }
                                if (this.goodsTemp.brandInfo == null || this.goodsTemp.brandInfo == '') {
                                    this.$message.error("请填写品牌简介")
                                    return;
                                }
                                if (this.province == null || this.province == ''
                                    || this.city == null || this.city == ''
                                    || this.area == null || this.area == '') {
                                    this.$message.error("请填写区域服务津贴")
                                    return;
                                }
                                if (this.temp.saleType == 1){
                                    if (this.supplyPrice == null || this.supplyPrice == ''){
                                        this.$message.error("请填写供货价")
                                        return;
                                    }
                                }
                            }
                            if (this.supplyPrice != null && this.supplyPrice != ''){
                                this.temp.supplyPrice=this.supplyPrice;
                            }
                            this.temp['json'] = true
                            // this.temp.prices =this.prices
                            if (this.userId != null && this.userId != '') {
                                if (this.shopReward < 5) {
                                    this.$message.error("店铺服务津贴不能少于5%");
                                    return;
                                }
                            }
                                if (this.maxClear != null && this.maxClear != ''){
                                    this.saleTypeInfoEntity.maxClear = this.maxClear
                                }
                                this.saleTypeInfoEntity.managerReward = this.shopReward / 100
                                if (this.province != null && this.province != '') {
                                    this.saleTypeInfoEntity.areaReward = this.province
                                }
                                if (this.city != null && this.city != '') {
                                    this.saleTypeInfoEntity.areaReward = this.saleTypeInfoEntity.areaReward + "_" + this.city
                                }
                                if (this.area != null && this.area != '') {
                                    this.saleTypeInfoEntity.areaReward = this.saleTypeInfoEntity.areaReward + "_" + this.area
                                }
                                if (this.voucherReward != null && this.voucherReward != '') {
                                    this.saleTypeInfoEntity.voucherReward = "0_" + this.voucherReward
                                }
                                if (this.couponReward != null && this.couponReward != '') {
                                    this.saleTypeInfoEntity.couponReward = "0_" + this.couponReward
                                }
                                if (this.cashReward != null && this.cashReward != '') {
                                    this.saleTypeInfoEntity.cashReward = "0_" + this.cashReward
                                }
                                if (this.maxCoupon != null && this.maxCoupon != ''){
                                    this.saleTypeInfoEntity.maxCoupon = this.maxCoupon
                                }
                            if (this.clearReward != null && this.clearReward != '') {
                                this.saleTypeInfoEntity.clearReward = "0_" + this.clearReward
                            }
                            this.temp.shopPrice = this.shopPrice
                            if (this.userId != null){
                                this.saleTypeInfoEntity.couponReward = 0
                            }

                            update(this.temp, this.saleTypeInfoEntity, this.flTypes, this.goodsTemp,this.act,this.adjustFlag).then((res) => {
                                for (const v of this.list) {
                                    if (v.id === this.temp.id) {
                                        if (this.temp.id == res.data.id) {
                                            this.temp = res.data
                                        }
                                        const index = this.list.indexOf(v)
                                        this.list.splice(oldIndex, 1, this.temp)
                                        break
                                    }
                                }

                                this.closeDialogForm()
                                this.$notify({
                                    title: '成功',
                                    message: '更新成功',
                                    type: 'success',
                                    duration: 2000
                                })
                            })
                        }
                    }
                )
            },
            closeDialogForm() {
                // 存在图片
                this.resetImgUrl()
                this.fenLeiTypes = [];
                this.province = null
                this.city = null
                this.area = null
                this.dialogFormVisible = false
                this.saleTypeInfoEntity.managerReward = 5
                this.shopPrice = null
                this.adjustFlag=false
                this.saleTypeFlag=false
                this.supplyPrice=null
                this.imgDiv='imgDiv'
            },
            handleDownload() {
                this.downloadLoading = true
                import('@/vendor/Export2Excel').then(excel => {
                    const tHeader = [
                        '序号'
                        ,
                        '上传者的ID'
                        ,
                        '所属分类'
                        ,
                        '产品名字'
                        ,
                        '单位'
                        ,
                        '虚拟销量'
                        ,
                        '产品重量kg'
                        ,
                        '描述'
                        ,
                        '分享标题'
                        ,
                        '原价'
                        ,
                        '现价'
                        ,
                        '利润'
                        ,
                        '排序'
                        ,
                        '库存'
                        ,
                        '开启规格'
                        ,
                        '是否上架'
                    ]
                    const filterVal = ['id'
                        , 'userId'
                        , 'type'
                        , 'name'
                        , 'unit'
                        , 'sales'
                        , 'weight'
                        , 'info'
                        , 'title'
                        , 'oldPrice'
                        , 'nowPrice'
                        , 'profit'
                        , 'sort'
                        , 'stock'
                        ,
                        'openSku'
                        ,
                        'shelf'
                    ]
                    const data = this.formatJson(filterVal, this.list)
                    excel.export_json_to_excel({
                        header: tHeader,
                        data,
                        filename: 'table-list'
                    })
                    this.downloadLoading = false
                })
            },
            formatJson(filterVal, jsonData) {
                return jsonData.map(v => filterVal.map(j => {
                        return v[j]
                    }
                ))
            },
            // 存在图片
            handleUpload(file) {
                this.qData.key = new Date().valueOf() + file.name
            },
            initQiniu() {
                // 获取七牛配置
                getToken().then(res => {
                    this.qData.token = res.data
                }).catch(error => {
                    console.log(error)
                })
            },
            handleimgUploadSuccess(response, file, fileList) {
                this.imgList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlebigImgUploadSuccess(response, file, fileList) {
                this.bigImgList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlemidImgUploadSuccess(response, file, fileList) {
                this.midImgList.push({name: file.response.key, url: domain + file.response.key})
            },
            handlepostImgUploadSuccess(response, file, fileList) {
                this.postImgList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleimgRemove(file, fileList) {
                for (var fn of this.imgList) {
                    if (fn.name === file.name) {
                        this.imgList.splice(this.imgList.indexOf(fn), 1)
                    }
                }
            },
            handlebigImgRemove(file, fileList) {
                for (var fn of this.bigImgList) {
                    if (fn.name === file.name) {
                        this.bigImgList.splice(this.bigImgList.indexOf(fn), 1)
                    }
                }
            },
            handlemidImgRemove(file, fileList) {
                for (var fn of this.midImgList) {
                    if (fn.name === file.name) {
                        this.midImgList.splice(this.midImgList.indexOf(fn), 1)
                    }
                }
            }, handlepostImgRemove(file, fileList) {
                for (var fn of this.postImgList) {
                    if (fn.name === file.name) {
                        this.postImgList.splice(this.postImgList.indexOf(fn), 1)
                    }
                }
            },
            handlePictureCardPreview(file) {
                this.dialogImageUrl = file.url
                this.dialogVisible = true
            },
            handlecompanyhealthLicenseUploadSuccess(response, file, fileList) {
                this.companyHealthLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlemanagehealthLicenseUploadSuccess(response, file, fileList) {
                this.manageHealthLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleapproveLicenseUploadSuccess(response, file, fileList) {
                this.approveLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleproduceLicenseUploadSuccess(response, file, fileList) {
                this.produceLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,

            handlemanageLicenseUploadSuccess(response, file, fileList) {
                this.manageLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlegmpLicenseUploadSuccess(response, file, fileList) {
                this.gmpLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handletrademarkLicenseUploadSuccess(response, file, fileList) {
                this.trademarkLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleproductAgreementUploadSuccess(response, file, fileList) {
                this.productAgreementList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlecirculateLicenseUploadSuccess(response, file, fileList) {
                this.circulateLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handledetectPhotocopyUploadSuccess(response, file, fileList) {
                this.detectPhotocopyList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlegoodsDeclarationUploadSuccess(response, file, fileList) {
                this.goodsDeclarationList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleproductListUploadSuccess(response, file, fileList) {
                this.productListList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlecompanyLicenseUploadSuccess(response, file, fileList) {
                this.companyLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleentrustAgreementUploadSuccess(response, file, fileList) {
                this.entrustAgreementList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlequalityGuarantyUploadSuccess(response, file, fileList) {
                this.qualityGuarantyList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlerecordTableUploadSuccess(response, file, fileList) {
                this.recordTableList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleepidemicPreventionUploadSuccess(response, file, fileList) {
                this.epidemicPreventionList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handleindustryLicenseUploadSuccess(response, file, fileList) {
                this.industryLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlesalesAuthorizationUploadSuccess(response, file, fileList) {
                this.salesAuthorizationList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handletestProveUploadSuccess(response, file, fileList) {
                this.testProveList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlecccLicenseUploadSuccess(response, file, fileList) {
                this.cccLicenseList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlegoodsProveUploadSuccess(response, file, fileList) {
                this.goodsProveList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlebrandAuthorizationUploadSuccess(response, file, fileList) {
                this.brandAuthorizationList.push({name: file.response.key, url: domain + file.response.key})
            }
            ,
            handlecompanyhealthLicenseRemove(file, fileList) {
                for (var fn of this.companyHealthLicenseList) {
                    if (fn.name === file.name) {
                        this.companyHealthLicenseList.splice(this.companyHealthLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlemanagehealthLicenseRemove(file, fileList) {
                for (var fn of this.manageHealthLicenseList) {
                    if (fn.name === file.name) {
                        this.manageHealthLicenseList.splice(this.manageHealthLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handleapproveLicenseRemove(file, fileList) {
                for (var fn of this.approveLicenseList) {
                    if (fn.name === file.name) {
                        this.approveLicenseList.splice(this.approveLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handleproduceLicenseRemove(file, fileList) {
                for (var fn of this.produceLicenseList) {
                    if (fn.name === file.name) {
                        this.produceLicenseList.splice(this.produceLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlemanageLicenseRemove(file, fileList) {
                for (var fn of this.manageLicenseList) {
                    if (fn.name === file.name) {
                        this.manageLicenseList.splice(this.manageLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlegmpLicenseRemove(file, fileList) {
                for (var fn of this.gmpLicenseList) {
                    if (fn.name === file.name) {
                        this.gmpLicenseList.splice(this.gmpLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handletrademarkLicenseRemove(file, fileList) {
                for (var fn of this.trademarkLicenseList) {
                    if (fn.name === file.name) {
                        this.trademarkLicenseList.splice(this.trademarkLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handleproductAgreementRemove(file, fileList) {
                for (var fn of this.productAgreementList) {
                    if (fn.name === file.name) {
                        this.productAgreementList.splice(this.productAgreementList.indexOf(fn), 1)
                    }
                }
            },
            handlecirculateLicenseRemove(file, fileList) {
                for (var fn of this.circulateLicenseList) {
                    if (fn.name === file.name) {
                        this.circulateLicenseList.splice(this.circulateLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handledetectPhotocopyRemove(file, fileList) {
                for (var fn of this.detectPhotocopyList) {
                    if (fn.name === file.name) {
                        this.detectPhotocopyList.splice(this.detectPhotocopyList.indexOf(fn), 1)
                    }
                }
            },
            handlegoodsDeclarationRemove(file, fileList) {
                for (var fn of this.goodsDeclarationList) {
                    if (fn.name === file.name) {
                        this.goodsDeclarationList.splice(this.goodsDeclarationList.indexOf(fn), 1)
                    }
                }
            },
            handleproductListRemove(file, fileList) {
                for (var fn of this.productListList) {
                    if (fn.name === file.name) {
                        this.productListList.splice(this.productListList.indexOf(fn), 1)
                    }
                }
            },
            handlecompanyLicenseRemove(file, fileList) {
                for (var fn of this.companyLicenseList) {
                    if (fn.name === file.name) {
                        this.companyLicenseList.splice(this.companyLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handleentrustAgreementRemove(file, fileList) {
                for (var fn of this.entrustAgreementList) {
                    if (fn.name === file.name) {
                        this.entrustAgreementList.splice(this.entrustAgreementList.indexOf(fn), 1)
                    }
                }
            },
            handlequalityGuarantyRemove(file, fileList) {
                for (var fn of this.qualityGuarantyList) {
                    if (fn.name === file.name) {
                        this.qualityGuarantyList.splice(this.qualityGuarantyList.indexOf(fn), 1)
                    }
                }
            },
            handlerecordTableRemove(file, fileList) {
                for (var fn of this.recordTableList) {
                    if (fn.name === file.name) {
                        this.recordTableList.splice(this.recordTableList.indexOf(fn), 1)
                    }
                }
            },
            handleepidemicPreventionRemove(file, fileList) {
                for (var fn of this.epidemicPreventionList) {
                    if (fn.name === file.name) {
                        this.epidemicPreventionList.splice(this.epidemicPreventionList.indexOf(fn), 1)
                    }
                }
            },
            handleindustryLicenseRemove(file, fileList) {
                for (var fn of this.industryLicenseList) {
                    if (fn.name === file.name) {
                        this.industryLicenseList.splice(this.industryLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlesalesAuthorizationRemove(file, fileList) {
                for (var fn of this.salesAuthorizationList) {
                    if (fn.name === file.name) {
                        this.salesAuthorizationList.splice(this.salesAuthorizationList.indexOf(fn), 1)
                    }
                }
            },
            handletestProveRemove(file, fileList) {
                for (var fn of this.testProveList) {
                    if (fn.name === file.name) {
                        this.testProveList.splice(this.testProveList.indexOf(fn), 1)
                    }
                }
            },
            handlecccLicenseRemove(file, fileList) {
                for (var fn of this.cccLicenseList) {
                    if (fn.name === file.name) {
                        this.cccLicenseList.splice(this.cccLicenseList.indexOf(fn), 1)
                    }
                }
            },
            handlegoodsProveRemove(file, fileList) {
                for (var fn of this.goodsProveList) {
                    if (fn.name === file.name) {
                        this.goodsProveList.splice(this.goodsProveList.indexOf(fn), 1)
                    }
                }
            },
            handlebrandAuthorizationRemove(file, fileList) {
                for (var fn of this.brandAuthorizationList) {
                    if (fn.name === file.name) {
                        this.brandAuthorizationList.splice(this.brandAuthorizationList.indexOf(fn), 1)
                    }
                }
            },
        }
    }
</script>
